class NumMatrix:

    def __init__(self, rows, cols):
        self.mat = [[0.0 for _ in range(cols)] for _ in range(rows)]
        
    @property
    def shape(self):
        return (len(self.mat),len(self.mat[0]))
    
    def is_empty(self):
        if not self.mat:
            return True
        else:
            return False

    def __getitem__(self, n):
        return self.mat[n]
        
    def num_rows(self):
        return self.shape[0]
    
    def num_cols(self):
        return self.shape[1]
    
    def get_value(self, i, j) -> int:
        if i>j:
            return self.mat[i][j]
        else:
            return self.mat[j][i]
    
    def set_value(self, i, j, value):
        if i>j:
            self.mat[i][j] = value
        else:
            self.mat[j][i] = value
    
    def print_mat(self):
        for r in self.mat:
            print('\t'.join(map(str,r)))
        print()
    
    def min_dist_indexes(self) -> tuple:
        m = self.mat[1][0]
        res= (1,0)
        for i in range(1,self.num_rows()):
            j,mv = min(enumerate(self.mat[i][:i]),key=lambda v:v[1])
            if mv < m :
                res = (i,j)
        return res

    def add_row(self, newrow) -> None:
        self.mat.append(newrow)

    def add_col(self, newcol) -> None:
        for r in range(self.num_rows()):
            self.mat[r].append(newcol[r])

    def remove_row(self, ind):
        del self.mat[ind]

    def remove_col(self, ind) -> None:
        for r in range(self.num_rows()):
            del self.mat[r][ind]

    def copy(self) -> "NumMatrix":
        from copy import deepcopy
        return deepcopy(self)
